﻿    using SqlSugar;
    using System;
    using Infov1.Models.Communication;

    namespace Infov1.Models.WorkRecord
    {
        /// <summary>
        /// 工作记录
        /// </summary>
        [SugarTable("k_work_record")]
        public class WorkRecordModel
        {
            //添加个属性 用于转换 处理方式  只转换 不参与数据库操作
            [SugarColumn(IsIgnore = true)]
            public string HandleTypeText { get; set; }  // 新增显示用属性

            [SugarColumn(ColumnName = "record_id", IsPrimaryKey = true, IsIdentity = true)]
            public int RecordId { get; set; }
            [SugarColumn(ColumnName = "kh_id")]
            public int CustomerId { get; set; }
            [SugarColumn(ColumnName = "comm_type_code")]
            public string CommTypeCode { get; set; }

            [SugarColumn(ColumnName = "customer_code")]
            public string CustomerCode { get; set; }

            [SugarColumn(ColumnName = "is_remote")]
            public bool IsRemote { get; set; }

            [SugarColumn(ColumnName = "details", IsNullable = true)]
            public string Details { get; set; }

            [SugarColumn(ColumnName = "result", IsNullable = true)]
            public string Result { get; set; }

            [SugarColumn(ColumnName = "creation_time")]
            public DateTime CreationTime { get; set; }
            [SugarColumn(ColumnName = "operator")]
            public String Operator { get; set; }

            [Navigate(NavigateType.OneToOne, nameof(CommTypeCode))]
            public CommunicationTypeModel CommType { get; set; }

            [Navigate(NavigateType.OneToOne, nameof(CustomerCode))]
            public WorkRecordCustomerModel Customer { get; set; }
        }
    }